export interface Tag {
  name: string
  type: 'info' | 'success' | 'warning' | 'error'
}

export interface AppItem {
  id: number
  title: string
  desc: string
  avatar: string
  lastActiveAt: string
  createAt: string
  updateAt: string
  type: 'agent' | 'process' | 'chat'
  isTop: boolean
  groupId: number
  tags: Tag[]
  modelId: number
}

export interface AppGroup {
  id: number
  title: string
  createAt: string
  updateAt: string
  order: number
  appList: AppItem[]
}

export type UserApps = AppGroup[]

export interface SessionItem {
  id: number
  chatId: string
  title: string
  desc: string
  isTop: boolean
  isCollect: boolean
  collectAt: string
  createAt: string
  updateAt: string
  isAi: boolean
  messageGroupList: MessageGroupList
}

export interface BaseMessage {
  id: number
  sender: 'user' | 'bot'
  timestamp: number
  type: 'text' | 'image' | 'file'
  appId: number
  sessionId: number
  groupId: number
}

export interface TextMessage extends BaseMessage {
  type: 'text'
  content: string
}

export interface ImageMessage extends BaseMessage {
  type: 'image'
  imageUrl: string
}

export interface FileMessage extends BaseMessage {
  type: 'file'
  fileName: string
  fileUrl: string
  fileSize: number
}

export type Message = TextMessage | ImageMessage | FileMessage

export type MessageList = Message[]

export interface MessageGroup {
  id: number
  sessionId: number
  messageList: MessageList
}

export type MessageGroupList = MessageGroup[]